function res = fun_finder_plot

function res=funfinderange(theta,phi,t,L, L2,M1,M2,g, minratio, maxratio,n)
    ratios=linspace(minratio,maxratio,n);
    L1s=ratios*L;
    Rs=L-L1s;
    bestrange=-500;
    bestratio=.000001;
    for i=1:n
        range=trebufunV2_rangefinder(theta,phi,t,Rs(i),L1s(i), L2,M1,M2,g);

        if (range>bestrange)
            bestrange=range;
            bestratio=ratios(i);
        end
    end
    res=bestratio;
end